import http from '@/http/http'
import cache from '@/utils/cache'
const defaultColor = {
  defaultTheme: 0,
  theme: [
    {
      menu: {
        titleColor: '#ccc',
        backgroundColor: '#666',
        textColor: '#ccc',
        activeTextColor: '#fff'
      },
      textColor: '#fff'
    }
  ]
}
function getColorList () {
  /**
     * 获取主题列表
     */
  http.request({
    url: '/Home/getColorList',
    method: 'POST'
  }).then(function (res) {
    if (res.status === 200) {
      cache.cache('color', res.data)
    } else {
      return defaultColor
    }
  }).catch(function () {
    return defaultColor
  })
}
export default {
  getColorList
}
